import type { postOrPutType } from "@/constants";
import type { IResult } from "@/types/common";
import { getAxios, commonAxiosJson, deleteAxios } from "@/utils/request.ts";
/* 获取机构组织信息地址 */
const url = "/back/master-agency";
/* 获取机构组织信息 */
export const getOrganizationInfo = <T>(): Promise<IResult<T>> => {
  return getAxios<T>(url);
};
/* 获取机构组织信息 */
export const getOrganizationAllInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url + "/auth-all", params);
};
/* 新增，更新机构组织信息 */
export const commonOrganizationInfo = <T, D>(params: D, type: postOrPutType): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url, params, type);
};
/* 删除机构组织信息 */
export const deleteOrganizationInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return deleteAxios<T, D>(url, params);
};
